#include "mainwindow.h"
#include <QFile>
#include <QApplication>
#include <QScreen>
#include "appkey.h"

int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
    QApplication a(argc, argv);

    //启动密钥服务类
    AppKey::Instance()->start();

    MainWindow *w = new MainWindow();
    w->show();
    w->setWindowTitle("中兴模块监控系统_V1.0——使用截止日期："+AppKey::Instance()->keyDate);

    // 获取屏幕的几何信息
    QRect screenRect = QGuiApplication::primaryScreen()->geometry();
    // 计算弹窗的中心位置
    int x = (screenRect.width() - w->width()) / 2;
    int y = (screenRect.height() - w->height()) / 2;

    // 设置弹窗的位置
    w->move(x, y);

    return a.exec();
}
